package com.example.javabasic.thread.classone.threadpool;

public class ThreadWait {

    public static Object obj = new Object();
    public static void main(String[] args) {
        //启动一个线程 并阻塞
        Thread t = new Thread(()->{
            Thread thread = new Thread(()->{
                System.out.println("执行了");
            });
            thread.setDaemon(false);
            synchronized (obj){
                try {
                    System.out.println("wait");
                    obj.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }

        });
        System.out.println("over");

    }
}
